package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import com.ruoyi.aitcommon.config.AITConfig;
import com.ruoyi.aitcommon.utils.LogUtils;
import com.ruoyi.aitcommon.utils.VersionUtils;

/**
 * 启动程序
 * 
 * @author cli
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class AITDemoApplication
{
    public static void main(String[] args)
    {
        preProcess();
        SpringApplication.run(AITDemoApplication.class, args);
        postProcess();
    }

    private static void preProcess(){
        // System.setProperty("spring.devtools.restart.enabled", "false");
        System.out.println("=====当前运行目录:"+System.getProperty("user.dir"));
    }
    private static void postProcess(){
//        输出启动后环境
        String msg="\r\n-------------[%s:%s]启动成功！----------------\r\n"
                + "启动端口:%s,运行路径:%s\r\n"
                + "ait.path=%s\r\n"
                + "-------------";
        msg=String.format(msg,
                AITConfig.getName(),
                AITConfig.getCodeVersion(),
                AITConfig.getPort(),
                //System.getProperty("user.dir"),
                AITConfig.getUserDir(),
                //System.getProperty("ait.path")
                AITConfig.getPath()
        );
        LogUtils.info(msg);
    }
}
